﻿
Public Module usshare
    Public Enum action
        submit = 0
        preview = 1
        delayJump = 2
        jump = 3
        urlkeys = 4
        have = 5

        unknown = 65535
    End Enum

    Public ReadOnly actionVerbs() As String = {"sbt", "prv", "djp", "jmp", "ukm", "hav"}

    Public Class query
        Public Const url As String = "u"
        Public Const key As String = "k"
        Public Const action As String = "a"
    End Class

    '/su/{key}  jump
    '/su/?u={url}&k={key}&a={action}

    Public Enum submitResult
        success
        invalidKey
        existingKey
        internalError

        unknown
    End Enum

    Public Function display(ByVal result As submitResult) As String
        Select Case result
            Case submitResult.success
                Return "success"
            Case submitResult.invalidKey
                Return "invalidKey"
            Case submitResult.existingKey
                Return "existingKey"
            Case submitResult.internalError
                Return "internalError"
            Case submitResult.unknown
                Return "unknown"
            Case Else
                assert(False, "should cover all the cases already.")
                Return "__INVALID__"
        End Select
    End Function
End Module
